<?php
    if(isset ($this->comment) && $this->comment!=false)
    {
        $comment=$this->comment;
  ?>
    <tr id="<?php echo 'tr'.$comment["stt"]; ?>">
        <td width="80px">
            <img class="avatar" alt="" src="<?php echo $comment["user_image"];?>" /><br/><br/>
            <span style="font-weight: bold; display:inline-block;float:left; padding:0 3px;">
                <?php echo $comment["user_name"];?>
            </span>
        </td>
        <td>
            <?php echo $comment["content"]; ?>
           <br/><br/>
           <?php echo 'Bình luận vào '.$comment["date"]; ?>
            <?php
                if(isset($comment["like"]))
                {
                    echo '&nbsp;&nbsp;';
                    echo 'Có <span id="numberlike" class="highlight">'. count($comment["like"]).'</span> người thích. ';
                }
                if($this->username !=null && $this->uid!=$comment["id_user"] )
                {
                    $liked=false;
                    if(isset($comment["like"]) && is_array($comment["like"]))
                    {
                        for($i=0;$i<count($comment["like"]);$i++)
                        {
                            if($comment["like"][$i]==$this->uid)
                            {
                                $liked=true;
                                break;
                            }
                        }
                    }
                    if(!$liked)
                    {
                        echo '&nbsp;&nbsp;';
                        echo '<a id="like'.$comment["stt"].'" class="menu" id="like">Thích</a>';
                    }
                }
            ?>
            <?php
                if($this->username !=null && $this->uid ==$comment["id_user"])
                {
                    echo '&nbsp;&nbsp;';
                    echo '<a id="delete'.$comment["stt"].'" class="menu">Xóa</a>';
                }
            ?>
        </td>
    </tr>
  <?php
    }
 ?>

   